package com.kxc.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.kxc.dao.RealDataDao;
import com.kxc.entity.MoniItem;
import com.kxc.entity.RealData;
import com.kxc.entity.WarnState;
/**
 * 测点实时数据业务类
 */
@Service
public class RealDataService {

	@Autowired
	private RealDataDao realDataDao;
	@Autowired
	private MoniItemService moniItemService;

	public RealData add(RealData realData) {
		return realDataDao.save(realData);
	}

	public RealData getByPointNum(String pointNum) {
		return realDataDao.findByPointNum(pointNum);
	}

	/**
	 * @return
	 */
	public List<RealData> getSurfaceDisplacement() {
		return realDataDao. findByMoniItem("SurfaceDisplacement");
	}

	/**
	 * 根据测点编号查找实时数据
	 * */
	public RealData findByPointNum(String pointNum) {
		return realDataDao.findByPointNum(pointNum);
	}

	public RealData update(RealData realData) {
		return realDataDao.save(realData);
	}

}
